home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / HUGEAR.ZIP / HARRAYS.H < prev    next >
C/C++ Source or Header  |  1994-11-26  |  24KB  |  754 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  HARRAYS.H                                                             */
  4. /*                                                                        */
  5. /*------------------------------------------------------------------------*/
  6.  
  7. #if !defined( HARRAYS_H )
  8. #define HARRAYS_H
  9.  
  10. #if defined(__DPMI32__) || defined(__WIN32__)
  11. #error Can not use huge arrays in a 32 bit model
  12. #endif
  13.  
  14. //#define TEMPLATES
  15.  
  16. #if !defined( __MEM_H )
  17. #include <mem.h>
  18. #endif  // __MEM_H
  19.  
  20. #if !defined( __CLASSLIB_DEFS_H )
  21. #include "classlib\defs.h"
  22. #endif  // __CLASSLIB_DEFS_H
  23.  
  24. #if !defined( __CLASSLIB_SHDDEL_H )
  25. #include "classlib\shddel.h"
  26. #endif  // __CLASSLIB_SHDDEL_H
  27.  
  28. #if !defined( HALLOCTR_H )
  29. #include "halloctr.h"
  30. #endif  // HALLOCTR_H
  31.  
  32. #if !defined( HVECTIMP_H )
  33. #include "hvectimp.h"
  34. #endif  // HVECTIMP_H
  35.  
  36. #pragma option -Vo-
  37. #if defined( BI_CLASSLIB_NO_po )
  38. #pragma option -po-
  39. #endif
  40.  
  41. /*------------------------------------------------------------------------*/
  42. /*                                                                        */
  43. /*  [INTERNAL USE ONLY]                                                   */
  44. /*                                                                        */
  45. /*  template <class Vect, class T> class THugeArrayAsVectorImp            */
  46. /*                                                                        */
  47. /*  Implements the type-independent array operations, using a vector      */
  48. /*  as the underlying implementation.  The type Vect specifies the        */
  49. /*  form of the vector, either a TCHugeVectorImp<T0>, a                   */
  50. /*  TSHugeVectorImp<T0>, a TICHugeVectorImp<T0>, or a                     */
  51. /*  TISHugeVectorImp<T0>.  The type T specifies the                       */
  52. /*  type of the objects to be put in the array.  When using               */
  53. /*  TCHugeVectorImp<T0> or a TSHugeVectorImp<T0> T should be the same as  */
  54. /*  T0. When using TICHugeVectorImp<T0> or TISHugeVectorImp<T0> T should  */
  55. /*  be of type pointer to T0.  See THugeArrayAsVector and                 */
  56. /*  TIHugeArrayAsVector for examples.                                     */
  57. /*                                                                        */
  58. /*------------------------------------------------------------------------*/
  59.  
  60. template <class Vect, class T> class THugeArrayAsVectorImp
  61. {
  62.  
  63. public:
  64.  
  65.     THugeArrayAsVectorImp( long upper, long lower, long delta ) :
  66.         Data( upper-lower+1,delta ),
  67.         Lowerbound( lower )
  68.         {
  69.         }
  70.  
  71.     long LowerBound() const
  72.         {
  73.         return Lowerbound;
  74.         }
  75.  
  76.     long UpperBound() const
  77.         {
  78.         return BoundBase( Data.Limit() )-1;
  79.         }
  80.  
  81.     unsigned long ArraySize() const
  82.         {
  83.         return Data.Limit();
  84.         }
  85.  
  86.     int IsFull() const
  87.         {
  88.         return Data.GetDelta() == 0 && Data.Count() >= Data.Limit();
  89.         }
  90.  
  91.     int IsEmpty() const
  92.         {
  93.         return Data.Count() == 0;
  94.         }
  95.  
  96.     unsigned long GetItemsInContainer() const
  97.         {
  98.         return Data.Count();
  99.         }
  100.  
  101.     void Reallocate( unsigned long sz, unsigned long offset = 0 )
  102.         {
  103.         Data.Resize( sz, offset );
  104.         }
  105.  
  106.  
  107.     void SetData( long loc, const T & t )
  108.         {
  109.         PRECONDITION( loc >= Lowerbound && loc <= UpperBound() );
  110.         Data[ ZeroBase(loc) ] = t;
  111.         }
  112.  
  113.     void RemoveEntry( long loc )
  114.         {
  115.         SqueezeEntry( ZeroBase(loc) );
  116.         }
  117.  
  118.     void SqueezeEntry( unsigned long loc )
  119.         {
  120.         PRECONDITION( loc < Data.Count() );
  121.         Data.Detach( loc );
  122.         }
  123.  
  124.     unsigned long ZeroBase( long loc ) const
  125.         {
  126.         return loc - Lowerbound;
  127.         }
  128.  
  129.     long BoundBase( unsigned long loc ) const
  130.         {
  131.         return loc == ULONG_MAX ? LONG_MAX : loc + Lowerbound;
  132.         }
  133.  
  134.     void Grow( long loc )
  135.         {
  136.         if( loc < LowerBound() )
  137.             Reallocate( ArraySize() + (loc - Lowerbound) );
  138.         else if( loc >= BoundBase( Data.Limit()) )
  139.             Reallocate( ZeroBase(loc) );
  140.         }
  141.  
  142.     long Lowerbound;
  143.  
  144.     Vect Data;
  145.  
  146. };
  147.  
  148. /*------------------------------------------------------------------------*/
  149. /*                                                                        */
  150. /*  [INTERNAL USE ONLY]                                                   */
  151. /*                                                                        */
  152. /*  template <class Vect, class T> class TDHugeArrayAsVectorImp           */
  153. /*                                                                        */
  154. /*  Implements the fundamental array operations for direct arrays, using  */
  155. /*  a vector as the underlying implementation.                            */
  156. /*                                                                        */
  157. /*------------------------------------------------------------------------*/
  158.  
  159. template <class Vect, class T> class TDHugeArrayAsVectorImp :
  160.     public THugeArrayAsVectorImp<Vect,T>
  161. {
  162.  
  163. public:
  164.  
  165.     typedef void (*IterFunc)(T __huge &, void *);
  166.     typedef int  (*CondFunc)(const T __huge &, void *);
  167.  
  168.     TDHugeArrayAsVectorImp( long upper, long lower, long delta ) :
  169.         THugeArrayAsVectorImp<Vect,T>( upper, lower, delta )
  170.         {
  171.         }
  172.  
  173.     int Add( const T & t )
  174.         {
  175.         return Data.Add(t);
  176.         }
  177.  
  178.     int Detach( const T & t )
  179.         {
  180.         return Data.Detach(t);
  181.         }
  182.  
  183.     int Detach( long loc )
  184.         {
  185.         return Data.Detach( ZeroBase(loc) );
  186.         }
  187.  
  188.     int Destroy( const T & t )
  189.         {
  190.         return Detach(t);
  191.         }
  192.  
  193.     int Destroy( long loc )
  194.         {
  195.         return Detach(loc);
  196.         }
  197.  
  198.     int HasMember( const T & t ) const
  199.         {
  200.         return Data.Find(t) != ULONG_MAX;
  201.         }
  202.  
  203.     long Find( const T & t ) const
  204.         {
  205.         return BoundBase( Data.Find( t ) );
  206.         }
  207.  
  208.     T __huge & operator []( long loc )
  209.         {
  210.         Grow( loc+1 );
  211.         return Data[ZeroBase(loc)];
  212.         }
  213.  
  214.     T __huge & operator []( long loc ) const
  215.         {
  216.         PRECONDITION( loc >= Lowerbound && ZeroBase(loc) < Data.Count() );
  217.         return Data[ZeroBase(loc)];
  218.         }
  219.  
  220.     void ForEach( IterFunc iter, void *args )
  221.         {
  222.         if( !IsEmpty() )
  223.             Data.ForEach( iter, args );
  224.         }
  225.  
  226.     T __huge *FirstThat( CondFunc cond, void *args ) const
  227.         {
  228.         if( IsEmpty() )
  229.             return 0;
  230.         return Data.FirstThat( cond, args );
  231.         }
  232.  
  233.     T __huge *LastThat( CondFunc cond, void *args ) const
  234.         {
  235.         if( IsEmpty() )
  236.             return 0;
  237.         return Data.LastThat( cond, args );
  238.         }
  239.  
  240.     void Flush()
  241.         {
  242.         Data.Flush();
  243.         }
  244.  
  245. protected:
  246.  
  247.     const T __huge & ItemAt( long i ) const
  248.         {
  249.         return Data[ ZeroBase(i) ];
  250.         }
  251.  
  252. };
  253.  
  254. /*------------------------------------------------------------------------*/
  255. /*                                                                        */
  256. /*  [INTERNAL USE ONLY]                                                   */
  257. /*                                                                        */
  258. /*  template <class Vect, class T> class TIHugeArrayAsVectorImp           */
  259. /*                                                                        */
  260. /*  Implements the fundamental array operations for indirect arrays,      */
  261. /*  using a vector as the underlying implementation.                      */
  262. /*                                                                        */
  263. /*------------------------------------------------------------------------*/
  264.  
  265. template <class Vect, class T> class TIHugeArrayAsVectorImp :
  266.     public THugeArrayAsVectorImp<Vect,T *>, public TShouldDelete
  267. {
  268.  
  269. public:
  270.  
  271.     typedef void (*IterFunc)(T &, void *);
  272.     typedef int  (*CondFunc)(const T &, void *);
  273.  
  274.     TIHugeArrayAsVectorImp( long upper, long lower, long delta ) :
  275.         THugeArrayAsVectorImp<Vect,T *>( upper, lower, delta )
  276.         {
  277.         }
  278.  
  279.     ~TIHugeArrayAsVectorImp()
  280.         {
  281.         Flush();
  282.         }
  283.  
  284.     int Add( T *t )
  285.         {
  286.         return Data.Add(t);
  287.         }
  288.  
  289.     int Detach( T *t,
  290.                 TShouldDelete::DeleteType dt = TShouldDelete::NoDelete )
  291.         {
  292.         return Data.Detach(t,DelObj(dt));
  293.         }
  294.  
  295.     int Detach( long loc,
  296.                 TShouldDelete::DeleteType dt = TShouldDelete::NoDelete )
  297.         {
  298.         return Data.Detach( ZeroBase(loc), DelObj(dt) );
  299.         }
  300.  
  301.     int Destroy( T *t )
  302.         {
  303.         return Detach(t,TShouldDelete::Delete);
  304.         }
  305.  
  306.     int Destroy( long loc )
  307.         {
  308.         return Detach(loc,TShouldDelete::Delete);
  309.         }
  310.  
  311.     int HasMember( const T *t ) const
  312.         {
  313.         return Data.Find(t) != ULONG_MAX;
  314.         }
  315.  
  316.     long Find( const T *t ) const
  317.         {
  318.         return BoundBase( Data.Find( t ) );
  319.         }
  320.  
  321.     T * __huge & operator []( long loc )
  322.         {
  323.         Grow( loc+1 );
  324.         return Data[ZeroBase(loc)];
  325.         }
  326.  
  327.     T * __huge & operator []( long loc ) const
  328.         {
  329.         PRECONDITION( loc >= Lowerbound && ZeroBase(loc) < Data.Count() );
  330.         return Data[ZeroBase(loc)];
  331.         }
  332.  
  333.     void ForEach( IterFunc iter, void *args )
  334.         {
  335.         if( !IsEmpty() )
  336.             Data.ForEach( iter, args );
  337.         }
  338.  
  339.     T *FirstThat( CondFunc cond, void *args ) const
  340.         {
  341.         if( IsEmpty() )
  342.             return 0;
  343.         return Data.FirstThat( cond, args );
  344.         }
  345.  
  346.     T *LastThat( CondFunc cond, void *args ) const
  347.         {
  348.         if( IsEmpty() )
  349.             return 0;
  350.         return Data.LastThat( cond, args );
  351.         }
  352.  
  353.     void Flush( DeleteType dt = DefDelete )
  354.         {
  355.         Data.Flush(DelObj(dt));
  356.         }
  357.  
  358. protected:
  359.  
  360.     T * __huge & ItemAt( long i ) const
  361.         {
  362.         return Data[ ZeroBase(i) ];
  363.         }
  364.  
  365. };
  366.  
  367. /*------------------------------------------------------------------------*/
  368. /*                                                                        */
  369. /*  template <class T,class Alloc> class TMHugeArrayAsVector              */
  370. /*  template <class T,class Alloc> class TMHugeArrayAsVectorIterator      */
  371. /*                                                                        */
  372. /*  Implements a managed array of objects of type T, using a vector as    */
  373. /*  the underlying implementation.                                        */
  374. /*                                                                        */
  375. /*------------------------------------------------------------------------*/
  376.  
  377. template <class T, class Alloc> class TMHugeArrayAsVectorIterator;
  378.  
  379. template <class T, class Alloc> class TMHugeArrayAsVector :
  380.     public TDHugeArrayAsVectorImp<TMCHugeVectorImp<T,Alloc>,T>
  381. {
  382.  
  383.     friend TMHugeArrayAsVectorIterator<T,Alloc>;
  384.  
  385. public:
  386.  
  387.     TMHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  388.         TDHugeArrayAsVectorImp<TMCHugeVectorImp<T,Alloc>,T>( upper, lower, delta )
  389.         {
  390.         }
  391.  
  392.     int AddAt( const T & t, long loc )
  393.         {
  394.         return Data.AddAt( t, ZeroBase(loc) );
  395.         }
  396.  
  397. };
  398.  
  399. template <class T, class Alloc> class TMHugeArrayAsVectorIterator :
  400.     public TMCHugeVectorIteratorImp<T,Alloc>
  401. {
  402.  
  403. public:
  404.  
  405.     TMHugeArrayAsVectorIterator( const TMHugeArrayAsVector<T,Alloc>& a ) :
  406.         TMCHugeVectorIteratorImp<T,Alloc>( a.Data ) {}
  407.  
  408. };
  409.  
  410. /*------------------------------------------------------------------------*/
  411. /*                                                                        */
  412. /*  template <class T> class THugeArrayAsVector                           */
  413. /*  template <class T> class THugeArrayAsVectorIterator                   */
  414. /*                                                                        */
  415. /*  Implements an array of objects of type T, using a vector as the       */
  416. /*  underlying implementation and THugeStandardAllocator as its memory    */
  417. /*  manager.                                                              */
  418. /*                                                                        */
  419. /*------------------------------------------------------------------------*/
  420.  
  421. template <class T> class THugeArrayAsVector :
  422.     public TMHugeArrayAsVector<T,THugeStandardAllocator>
  423. {
  424.  
  425. public:
  426.  
  427.     THugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  428.         TMHugeArrayAsVector<T,THugeStandardAllocator>( upper, lower, delta )
  429.         {
  430.         }
  431.  
  432. };
  433.  
  434. template <class T> class THugeArrayAsVectorIterator :
  435.     public TMHugeArrayAsVectorIterator<T,THugeStandardAllocator>
  436. {
  437.  
  438. public:
  439.  
  440.     THugeArrayAsVectorIterator( const THugeArrayAsVector<T>& a ) :
  441.         TMHugeArrayAsVectorIterator<T,THugeStandardAllocator>(a)
  442.         {
  443.         }
  444.  
  445. };
  446.  
  447. /*------------------------------------------------------------------------*/
  448. /*                                                                        */
  449. /*  template <class T,class Alloc> class TMSHugeArrayAsVector             */
  450. /*  template <class T,class Alloc> class TMSHugeArrayAsVectorIterator     */
  451. /*                                                                        */
  452. /*  Implements a managed, sorted array of objects of type T, using a      */
  453. /*  vector as the underlying implementation.                              */
  454. /*                                                                        */
  455. /*------------------------------------------------------------------------*/
  456.  
  457. template <class T, class Alloc> class TMSHugeArrayAsVectorIterator;
  458.  
  459. template <class T, class Alloc> class TMSHugeArrayAsVector :
  460.     public TDHugeArrayAsVectorImp<TMSHugeVectorImp<T,Alloc>,T>
  461. {
  462.  
  463.     friend TMSHugeArrayAsVectorIterator<T,Alloc>;
  464.  
  465. public:
  466.  
  467.     TMSHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  468.         TDHugeArrayAsVectorImp<TMSHugeVectorImp<T,Alloc>,T>( upper, lower, delta )
  469.         {
  470.         }
  471.  
  472. };
  473.  
  474. template <class T, class Alloc> class TMSHugeArrayAsVectorIterator :
  475.     public TMSHugeVectorIteratorImp<T,Alloc>
  476. {
  477.  
  478. public:
  479.  
  480.     TMSHugeArrayAsVectorIterator( const TMSHugeArrayAsVector<T,Alloc>& a ) :
  481.         TMSHugeVectorIteratorImp<T,Alloc>( a.Data ) {}
  482.  
  483. };
  484.  
  485. /*------------------------------------------------------------------------*/
  486. /*                                                                        */
  487. /*  template <class T> class TSHugeArrayAsVector                          */
  488. /*  template <class T> class TSHugeArrayAsVectorIterator                  */
  489. /*                                                                        */
  490. /*  Implements a sorted array of objects of type T, using a vector as     */
  491. /*  the underlying implementation and THugeStandardAllocator as its       */
  492. /*  memory manager.                                                       */
  493. /*                                                                        */
  494. /*------------------------------------------------------------------------*/
  495.  
  496. template <class T> class TSHugeArrayAsVector :
  497.     public TMSHugeArrayAsVector<T,THugeStandardAllocator>
  498. {
  499.  
  500. public:
  501.  
  502.     TSHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  503.         TMSHugeArrayAsVector<T,THugeStandardAllocator>( upper, lower, delta )
  504.         {
  505.         }
  506.  
  507. };
  508.  
  509. template <class T> class TSHugeArrayAsVectorIterator :
  510.     public TMSHugeArrayAsVectorIterator<T,THugeStandardAllocator>
  511. {
  512.  
  513. public:
  514.  
  515.     TSHugeArrayAsVectorIterator( const TSHugeArrayAsVector<T>& a ) :
  516.         TMSHugeArrayAsVectorIterator<T,THugeStandardAllocator>( a ) {}
  517.  
  518. }
  519.  
  520. /*------------------------------------------------------------------------*/
  521. /*                                                                        */
  522. /*  template <class T,class Alloc> class TMIHugeArrayAsVector             */
  523. /*  template <class T,class Alloc> class TMIHugeArrayAsVectorIterator     */
  524. /*                                                                        */
  525. /*  Implements a managed indirect array of objects of type T, using a     */
  526. /*  vector as the underlying implementation.                              */
  527. /*                                                                        */
  528. /*------------------------------------------------------------------------*/
  529.  
  530. template <class T, class Alloc> class TMIHugeArrayAsVectorIterator;
  531.  
  532. template <class T, class Alloc> class TMIHugeArrayAsVector :
  533.     public TIHugeArrayAsVectorImp<TMICHugeVectorImp<T,Alloc>,T>
  534. {
  535.  
  536.     friend TMIHugeArrayAsVectorIterator<T,Alloc>;
  537.  
  538. public:
  539.  
  540.     TMIHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  541.         TIHugeArrayAsVectorImp<TMICHugeVectorImp<T,Alloc>,T>( upper, lower, delta )
  542.         {
  543.         }
  544.  
  545.     int AddAt( T *t, long loc )
  546.         {
  547.         return Data.AddAt( t, ZeroBase(loc) );
  548.         }
  549.  
  550. };
  551.  
  552. template <class T, class Alloc> class TMIHugeArrayAsVectorIterator :
  553.     public TMICHugeVectorIteratorImp<T,Alloc>
  554. {
  555.  
  556. public:
  557.  
  558.     TMIHugeArrayAsVectorIterator( const TMIHugeArrayAsVector<T,Alloc>& a ) :
  559.         TMICHugeVectorIteratorImp<T,Alloc>( a.Data ) {}
  560.  
  561. };
  562.  
  563. /*------------------------------------------------------------------------*/
  564. /*                                                                        */
  565. /*  template <class T> class TIHugeArrayAsVector                          */
  566. /*  template <class T> class TIHugeArrayAsVectorIterator                  */
  567. /*                                                                        */
  568. /*  Implements an indirect array of objects of type T, using a vector as  */
  569. /*  the underlying implementation and THugeStandardAllocator as its       */
  570. /*  memory manager.                                                       */
  571. /*                                                                        */
  572. /*------------------------------------------------------------------------*/
  573.  
  574. template <class T> class TIHugeArrayAsVector :
  575.     public TMIHugeArrayAsVector<T,THugeStandardAllocator>
  576. {
  577.  
  578. public:
  579.  
  580.     TIHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  581.         TMIHugeArrayAsVector<T,THugeStandardAllocator>( upper, lower, delta )
  582.         {
  583.         }
  584.  
  585. };
  586.  
  587. template <class T> class TIHugeArrayAsVectorIterator :
  588.     public TMIHugeArrayAsVectorIterator<T,THugeStandardAllocator>
  589. {
  590.  
  591. public:
  592.  
  593.     TIHugeArrayAsVectorIterator( const TIHugeArrayAsVector<T>& a ) :
  594.         TMIHugeArrayAsVectorIterator<T,THugeStandardAllocator>(a)
  595.         {
  596.         }
  597.  
  598. };
  599.  
  600. /*------------------------------------------------------------------------*/
  601. /*                                                                        */
  602. /*  template <class T,class Alloc> class TMISHugeArrayAsVector            */
  603. /*  template <class T,class Alloc> class TMISHugeArrayAsVectorIterator    */
  604. /*                                                                        */
  605. /*  Implements a managed, indirect sorted array of objects of type T,     */
  606. /*  using a vector as the underlying implementation.                      */
  607. /*                                                                        */
  608. /*------------------------------------------------------------------------*/
  609.  
  610. template <class T, class Alloc> class TMISHugeArrayAsVectorIterator;
  611.  
  612. template <class T, class Alloc> class TMISHugeArrayAsVector :
  613.     public TIHugeArrayAsVectorImp<TMISHugeVectorImp<T,Alloc>,T>
  614. {
  615.  
  616.     friend TMISHugeArrayAsVectorIterator<T,Alloc>;
  617.  
  618. public:
  619.  
  620.     TMISHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  621.         TIHugeArrayAsVectorImp<TMISHugeVectorImp<T,Alloc>,T>( upper, lower, delta )
  622.         {
  623.         }
  624.  
  625. };
  626.  
  627. template <class T, class Alloc> class TMISHugeArrayAsVectorIterator :
  628.     public TMISHugeVectorIteratorImp<T,Alloc>
  629. {
  630.  
  631. public:
  632.  
  633.     TMISHugeArrayAsVectorIterator( const TMISHugeArrayAsVector<T,Alloc>& a ) :
  634.         TMISHugeVectorIteratorImp<T,Alloc>( a.Data ) {}
  635.  
  636. };
  637.  
  638. /*------------------------------------------------------------------------*/
  639. /*                                                                        */
  640. /*  template <class T> class TISHugeArrayAsVector                         */
  641. /*  template <class T> class TISHugeArrayAsVectorIterator                 */
  642. /*                                                                        */
  643. /*  Implements an indirect sorted array of objects of type T, using a     */
  644. /*  vector as the underlying implementation and THugeStandardAllocator as */
  645. /*  its memory manager.                                                   */
  646. /*                                                                        */
  647. /*------------------------------------------------------------------------*/
  648.  
  649. template <class T> class TISHugeArrayAsVector :
  650.     public TMISHugeArrayAsVector<T,THugeStandardAllocator>
  651. {
  652.  
  653. public:
  654.  
  655.     TISHugeArrayAsVector( long upper, long lower = 0, long delta = 0 ) :
  656.         TMISHugeArrayAsVector<T,THugeStandardAllocator>( upper, lower, delta )
  657.         {
  658.         }
  659.  
  660. };
  661.  
  662. template <class T> class TISHugeArrayAsVectorIterator :
  663.     public TMISHugeArrayAsVectorIterator<T,THugeStandardAllocator>
  664. {
  665.  
  666. public:
  667.  
  668.     TISHugeArrayAsVectorIterator( const TISHugeArrayAsVector<T>& a ) :
  669.         TMISHugeArrayAsVectorIterator<T,THugeStandardAllocator>(a)
  670.         {
  671.         }
  672.  
  673. };
  674.  
  675. /*------------------------------------------------------------------------*/
  676. /*                                                                        */
  677. /*  template <class T> class THugeArray                                   */
  678. /*  template <class T> class THugeArrayIterator                           */
  679. /*                                                                        */
  680. /*  Easy names for THugeArrayAsVector and THugeArrayAsVectorIterator      */
  681. /*                                                                        */
  682. /*------------------------------------------------------------------------*/
  683.  
  684. template <class T> class THugeArray :
  685.     public THugeArrayAsVector<T>
  686. {
  687.  
  688. public:
  689.  
  690.     THugeArray( long upper, long lower = 0, long delta = 0 ) :
  691.         THugeArrayAsVector<T>( upper, lower, delta )
  692.         {
  693.         }
  694.  
  695. };
  696.  
  697. template <class T> class THugeArrayIterator :
  698.     public THugeArrayAsVectorIterator<T>
  699. {
  700.  
  701. public:
  702.  
  703.  
  704.     THugeArrayIterator( const THugeArray<T>& a ) :
  705.         THugeArrayAsVectorIterator<T>(a)
  706.         {
  707.         }
  708.  
  709. };
  710.  
  711. /*------------------------------------------------------------------------*/
  712. /*                                                                        */
  713. /*  template <class T> class TSHugeArray                                  */
  714. /*  template <class T> class TSHugeArrayIterator                          */
  715. /*                                                                        */
  716. /*  Easy names for TSHugeArrayAsVector and TSHugeArrayAsVectorIterator    */
  717. /*                                                                        */
  718. /*------------------------------------------------------------------------*/
  719.  
  720. template <class T> class TSHugeArray :
  721.     public TSHugeArrayAsVector<T>
  722. {
  723.  
  724. public:
  725.  
  726.     TSHugeArray( long upper, long lower = 0, long delta = 0 ) :
  727.         TSHugeArrayAsVector<T>( upper, lower, delta )
  728.         {
  729.         }
  730.  
  731. };
  732.  
  733. template <class T> class TSHugeArrayIterator :
  734.     public TSHugeArrayAsVectorIterator<T>
  735. {
  736.  
  737. public:
  738.  
  739.  
  740.     TSHugeArrayIterator( const TSHugeArray<T>& a ) :
  741.         TSHugeArrayAsVectorIterator<T>(a)
  742.         {
  743.         }
  744.  
  745. };
  746.  
  747. #if defined( BI_CLASSLIB_NO_po )
  748. #pragma option -po.
  749. #endif
  750.  
  751. #pragma option -Vo.
  752.  
  753. #endif  // HARRAYS_H
  754.